﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.TrainUI {
    import flash.display.*;
    import org.aswing.*;
    import Display.MarketUI.*;
    import org.aswing.ext.*;
    import Display.aswingui.*;

    public class TrainStationScrollingList extends MarketScrollingList {

        public function TrainStationScrollingList(_arg1:Array, _arg2:int, _arg3:int=5, _arg4:int=1){
            super(_arg1, TrainStopCellFactory, _arg2, _arg3, _arg4);
        }
        override protected function makeButtons():void{
            var _local1:DisplayObject = (new (TrainStationDialog.assetDict["btn_prev_up"])() as DisplayObject);
            var _local2:DisplayObject = (new (TrainStationDialog.assetDict["btn_prev_over"])() as DisplayObject);
            var _local3:DisplayObject = (new (TrainStationDialog.assetDict["btn_prev_down"])() as DisplayObject);
            var _local4:DisplayObject = (new (TrainStationDialog.assetDict["btn_next_up"])() as DisplayObject);
            var _local5:DisplayObject = (new (TrainStationDialog.assetDict["btn_next_over"])() as DisplayObject);
            var _local6:DisplayObject = (new (TrainStationDialog.assetDict["btn_next_down"])() as DisplayObject);
            leftBtn = new JButton();
            leftBtn.wrapSimpleButton(new SimpleButton(_local1, _local2, _local3, _local1));
            leftBtn.setEnabled(false);
            rightBtn = new JButton();
            rightBtn.wrapSimpleButton(new SimpleButton(_local4, _local5, _local6, _local4));
            if (m_data.length <= this.numItems){
                rightBtn.setEnabled(false);
            };
            rightBtn.addActionListener(moveRight, 0, true);
            leftBtn.addActionListener(moveLeft, 0, true);
        }
        override protected function makeData():void{
            var _local1:int = m_data.length;
            m_model = new VectorListModel();
            var _local2:int;
            while (_local2 < _local1) {
                m_model.append(m_data[_local2]);
                m_curCount++;
                _local2++;
            };
            m_dataList = new GridList(m_model, m_cellFactory, m_columns, m_rows);
            m_scrollPane = new JScrollPane(m_dataList, JScrollPane.SCROLLBAR_NEVER, JScrollPane.SCROLLBAR_NEVER);
        }
        override protected function prepare():void{
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            _local1.append(ASwingHelper.verticalStrut(-30));
            _local1.append(leftBtn);
            var _local2:JPanel = ASwingHelper.makeSoftBoxJPanelVertical(SoftBoxLayout.CENTER);
            _local2.append(ASwingHelper.verticalStrut(-30));
            _local2.append(rightBtn);
            this.appendAll(_local1, m_scrollPane, _local2);
            ASwingHelper.prepare(this);
        }
        override protected function get scrollingListGap():int{
            return (7);
        }
        override protected function get scrollingListItemWidth():Number{
            return ((TrainStopCell.CELL_WIDTH + 7));
        }
        override protected function get scrollingListItemHeight():Number{
            return (TrainStopCell.CELL_HEIGHT);
        }
        override public function get numItems():int{
            return (m_columns);
        }

    }
}//package Display.TrainUI 
